﻿using System.Diagnostics;

namespace System {
    /// <summary>
    /// 统一返回值
    /// </summary>
    [Serializable]
    [DebuggerDisplay("success:{success}")]
    public class Result {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="flg"></param>
        public Result(bool flg=true) {
            if(flg) {
                success=true;
                msg="操作成功";
            } else {
                success=false;
                msg="未知错误";
            }
        }
        /// <summary>
        /// 是否成功
        /// </summary>
        public bool success { get; set; }
        /// <summary>
        /// 提示
        /// </summary>
        public string msg { get; set; }
        /// <summary>
        ///  数据
        /// </summary>
        public object data { get; set; }
    }
}
